.frame{
    position: absolute;
    width: 400px;
    height: 400px;
    inset: 0;
    margin: auto;
    background-color: #4b4841;
    box-shadow: 1px 2px 10px rgba(0,0,0,0.3);
    border-radius: 2px;
}

.card{
    position: absolute;
    width: 320px;
    height: 180px;
    perspective: 800px;
    // top: 110px;
    // left: 40px;
    inset: 0;
    margin: auto;
    // background-color: azure;

    &:hover .flip{
        transform: rotateX(180deg) translate3d(0,0,0);
        box-shadow: 8px -10px 15px rgba(0,0,0,0.5);
    }

    .flip{
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
        transition: all 1s ease-in-out;
        perspective: 1000px;
        box-shadow: 8px 10px 15px rgba(0,0,0,0.5);
    }

    .front,
    .back{
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #ffce4e;
        backface-visibility: hidden;
        border-radius: 3px;
        overflow: hidden;
        text-align: center;
    }

    .front{
        z-index: 2;
        transform: rotateX(0);

        img{
            position: relative;
            top: 52px;
            animation: bike .6s ease-in-out infinite;
            transform-origin: 50% 100%;
        }

        .street{
            position: absolute;
            top: 127px;
            left: 80px;
            width: 160px;
            height: 3px;
            overflow: hidden;


            @for $i from 1 through 9{
                .stripe-#{$i}{
                    position: absolute;
                    right: -25px;
                    top: 0;
                    height: 3px;
                    width: (2 + $i * 2) + px;
                    background: #4b4841;
                    border-radius: 3px;
                    animation: street (0.8 + random(2) / 10)+s linear (random(10)/10)+s infinite;
                }
            }
        }
    }

    .back{
        transform: rotateX(180deg);

        img{
            position: relative;
            z-index: 1;
            top: 57px;
            animation: helicopter 1.5s ease-in-out infinite;
            animation-fill-mode: both;
        }

        .sky{
            position: absolute;
            top: 0;
            bottom: 0;
            left: 80px;
            width: 160px;
            overflow: hidden;

            @for $i from 1 through 9{
                .cloud-#{$i}{
                    position: absolute;
                    right: -25px;
                    top: (20 + $i * 14)+px;
                    height: 3px;
                    width: (10+random($limit: 150)/10)+px;
                    background:#4b4841;
                    border-radius: 3px;
                    animation: cloud (0.6+random($limit: 2)/10)+s linear (random($limit: 10)/10)+s infinite;
                }
            }
        }
    }

}


@keyframes bike{
    0%, 100%{
        transform: scaleY(1);
    }
    50%{
        transform: scaleY(1.03);
    }
}

@keyframes street {
    0%{
        transform: translate3d(0,0,0) scaleX(1);
    }
    100%{
        transform: translate3d(-210px,0,0) scaleX(.8);
    }
}

@keyframes helicopter {
    0%, 100%{
        transform: translate3d(0, -5px, 0);
    }
    50%{
        transform: translate3d(0,5px, 0);
    }
}

@keyframes cloud {
    0%{
        transform: translateX(0) scaleX(1);
    }
    100%{
        transform: translateX(-210px) scaleX(.8);
    }
}